<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>isNumber</title>
</head>

<body>
    <script>
        const isNumber = val => typeof val === 'number' && val === val;
        document.write(`isNumber(1)的结果是:${isNumber(1)};isNumber(NaN)的结果是:${isNumber(NaN)}`)
    </script>

</body>

</html>